The King of Ai was a figure noted in the Old Testament. In approximately 1400 BCE, the king brought his forces out to battle against the Israelites at the Battle of Ai. When he became overconfident and pursued the "retreating" Israelites, the enemy ambush units seized and burnt the city. While all of his compatriots were struck down, he was taken alive. After all of the men, women, and soldiers of Ai were killed, Israelite leader Joshua hanged him on a tree until evening, and then at sunset the israelites placed a heap of rocks on top of the king at the city gates according to Joshuas orders.